package com.kitten.comment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author kitten
 */
@Getter
@AllArgsConstructor
public enum CommentUnlikeLuaResultEnum {

    NOT_EXIST(-1L),
    // 评论已点赞
    COMMENT_LIKED(1L),
    // 评论点赞成功
    COMMENT_NOT_LIKED(0L),
    ;

    private final Long code;

    public static CommentUnlikeLuaResultEnum valueOf(Long code) {
        for (CommentUnlikeLuaResultEnum commentUnlikeLuaResultEnum : CommentUnlikeLuaResultEnum.values()) {
            if (Objects.equals(code, commentUnlikeLuaResultEnum.getCode())) {
                return commentUnlikeLuaResultEnum;
            }
        }
        return null;
    }

}
